package com.bbj.ch4_abstract.demo1;

/**
 * @author
 * @date 2024/4/28、14:08
 */
public class GoldCard extends Card{
    public GoldCard() {

    }

    public GoldCard(String userName, Double balance) {
        super(userName, balance);
    }

    @Override
    public void pay(Double money) {
        System.out.println("========皇上皇：支付系统========");
        System.out.println("您的卡片当前余额为：" + getBalance() + "元");
        System.out.println("您当前消费" + money + "元");
        System.out.println("您的卡片当前等级为金卡，享受8折优惠");
        double realMoney = money * 0.8;
        setBalance(getBalance() - realMoney);
        System.out.println(getUserName() + "：优惠后，本次实际消费：" + realMoney + "，消费后，账户余额为：" + getBalance());
    }
}
